var dashboard = {
    init : function() {
        var me = this;
        common.screenAutoFit();
        $(window).resize(function() {
            common.screenAutoFit();
        });
        me.pieInit();
        me.gaugesInit();
        me.lineInit();
        me.barInit();
    },
    gaugesInit : function() {
        charts.gauge('pie13',{value:  0.45, style: 0 });
        charts.gauge('pie23',{value:  0.65, style: 1 });
        charts.gauge('pie33',{value:  0.48, style: 2 });
    },
    pieInit : function(){
        charts.pie('pie14',[
            {value: 547 ,name: '男'},
            {value: 274, name: '女'}
        ]);
        charts.pie('pie15',[
            {value: 784 ,name: '男'},
            {value: 234, name: '女'}
        ]);
        charts.pie('pie22',[
            {value: 765 ,name: '男'},
            {value: 345, name: '女'}
        ]);
        charts.pie('pie25',[
            {value: 323 ,name: '男'},
            {value: 657, name: '女'}
        ]);
        charts.pie('pie34',[
            {value: 332 ,name: '男'},
            {value: 564, name: '女'}
        ]);
        charts.pie('pie35',[
            {value: 123 ,name: '男'},
            {value: 435, name: '女'}
        ]);

    },
    lineInit(){
        charts.line('line1',{
            title: '本学期每天学校跳绳数 (w）',
            style: 0,
            dataX: ['12.21', '12.22', '12.23', '12.24', '12.25', '12.26', '12.27', '12.28'],
            dataY: [220, 182, 191, 134, 150, 120, 110, 125 ]
        });
        charts.line('line2',{
            title: '本学期每天学校跳绳时长 (h)',
            style: 1,
            dataX: ['12.21', '12.22', '12.23', '12.24', '12.25', '12.26', '12.27', '12.28'],
            dataY: [120, 110, 125, 145, 122, 165, 122, 220]
        });
        charts.line('line3',{
            title: '本学期每天学校跑步里程 (km）',
            style: 0,
            dataX: ['12.21', '12.22', '12.23', '12.24', '12.25', '12.26', '12.27', '12.28'],
            dataY: [120, 110, 125, 145, 122, 165, 122, 220]
        });
        charts.line('line4',{
            title: '本学期每天学校跑步时长 (h）',
            style: 1,
            dataX: ['12.21', '12.22', '12.23', '12.24', '12.25', '12.26', '12.27', '12.28'],
            dataY: [220, 182, 191, 134, 150, 120, 110, 125 ]
        });
    },
    barInit(){
        charts.bar('bar1',{
            title: '本学期跳绳年级计划完成情况',
            style: 0,
            dataX: ['一年级', '二年级', '三年级', '四年级', '五年级','六年级'],
            dataY: [90,88,75,73,65,54]
        });
        charts.bar('bar2',{
            title: '本学期跑步年级计划完成情况',
            style: 1,
            dataX: ['一年级', '二年级', '三年级', '四年级', '五年级','六年级'],
            dataY: [100,88,84,79,66,47]
        });
    },
}

$(function () {
    dashboard.init();
});